Last updated: 2025-10-16

Checks: 5 2

Knit directory: 13384_GBMHGG_SPP1_Xenium/

This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown is untracked by Git. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20251010) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Using absolute paths to the files within your workflowr project makes it difficult for you and others to run your code on a different machine. Change the absolute path(s) below to the suggested relative path(s) to make your code more reproducible.

absolute relative
/home/hnatri/13384_GBMHGG_SPP1_Xenium/ .
/home/hnatri/13384_GBMHGG_SPP1_Xenium/code/colors_themes.R code/colors_themes.R
/home/hnatri/13384_GBMHGG_SPP1_Xenium/code/plot_functions.R code/plot_functions.R

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 42151ab. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    analysis/figure/
    Ignored:    analysis/plot_all_features.html

Untracked files:
    Untracked:  analysis/plot_all_features_custom.Rmd

Unstaged changes:
    Modified:   analysis/plot_all_features.Rmd

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


There are no past versions. Publish this analysis with wflow_publish() to start tracking its development.


Import packages

suppressPackageStartupMessages({
  library(workflowr)
  library(arrow)
  library(Seurat)
  library(SeuratObject)
  library(SeuratDisk)
  library(tidyverse)
  library(tibble)
  library(ggplot2)
  library(ggpubr)
  library(ggrepel)
  library(googlesheets4)
  library(workflowr)})

Environment variables and helper functions

setwd("/home/hnatri/13384_GBMHGG_SPP1_Xenium/")
set.seed(9999)
options(scipen = 99999)
options(ggrepel.max.overlaps = Inf)

#source("/home/hnatri/13384_GBMHGG_SPP1_Xenium/code/colors_themes.R")
source("/home/hnatri/13384_GBMHGG_SPP1_Xenium/code/plot_functions.R")

# Cluster colors
main_clusters <- as.factor(c(0, seq(1:20)))
main_cluster_col <- colorRampPalette(brewer.pal(10, "Paired"))(nb.cols <- length(main_clusters))
names(main_cluster_col) <- levels(main_clusters)

Import data

# Copied to isilon /tgen_labs/banovich/PIPAC/Seurat
seurat_data <- readRDS("/tgen_labs/banovich/BCTCSF/13384_GBMHGG_Xenium/Seurat/spatial_clustered_NN30_PC50_Seurat.rds")

seurat_data <- NormalizeData(seurat_data)
VariableFeatures(seurat_data) <- rownames(seurat_data)
seurat_data <- ScaleData(seurat_data)
DimPlot(seurat_data,
        reduction = "sp",
        group.by = "leiden_1.0",
        cols = main_cluster_col,
        raster = T,
        label = F) +
    coord_fixed(ratio = 1) +
    theme_minimal() +
    NoLegend() +
    ggtitle("TMA1_0069754")

Feature annotations

gs4_deauth()
all_sheets  <- gs4_get("https://docs.google.com/spreadsheets/d/1V1YxYPMI-J1ilZ3ooTDM323s5VMIf7E9f5XsuIOaGAg/edit?usp=sharing")
sheet_names(all_sheets)
[1] "Metadata"                          "Main cluster annotations"         
[3] "Immune annotations"                "Immune top markers"               
[5] "Non-immune annotations"            "Non-immune top markers"           
[7] "Multi-tissue and cancer basepanel" "Custom probes"                    
multissue_cancer <- read_sheet(all_sheets, sheet = "Multi-tissue and cancer basepanel")
custom_panel <- read_sheet(all_sheets, sheet = "Custom probes")

Annotation groups

#unique(multissue_cancer$Annotation)

fibroblast_markers <- multissue_cancer[grep("Fibroblast", multissue_cancer$Annotation),]$Gene # 65

immune_markers <- multissue_cancer[grep("Immune", multissue_cancer$Annotation),]$Gene # 6

macrophage_markers <- multissue_cancer[grep("Macrophage", multissue_cancer$Annotation),]$Gene # 70
granulocyte_markers <- multissue_cancer[grep("Granulocytes", multissue_cancer$Annotation),]$Gene # 25
dendritic_markers <- c(multissue_cancer[grep("dendritic", multissue_cancer$Annotation),]$Gene,
                       multissue_cancer[grep("Dendritic", multissue_cancer$Annotation),]$Gene) #22

tcell_markers <- multissue_cancer[grep("T cells", multissue_cancer$Annotation),]$Gene # 62
bcell_markers <- multissue_cancer[grep("B cells", multissue_cancer$Annotation),]$Gene # 45

proliferation_markers <- multissue_cancer[grep("Proliferation", multissue_cancer$Annotation),]$Gene # 7
endothelial_markers <- multissue_cancer[grep("Endothelial", multissue_cancer$Annotation),]$Gene # 82

Spatial plots of all base-panel genes

all_genes <- c(custom_panel$Gene) #multissue_cancer$Gene
all_genes <- gsub("CD11b", "ITGAM", all_genes)
all_genes <- gsub("CD11c", "ITGAX", all_genes)
all_genes <- gsub("CD31", "PECAM1", all_genes)
all_genes <- gsub("CD45", "PTPRC", all_genes)
all_genes <- gsub("HLA-DR", "HLA-DRA", all_genes)
all_genes <- gsub("HLA.DPB1", "HLA-DPB1", all_genes)
all_genes <- gsub("IFNGR", "IFNGR1", all_genes)
all_genes <- gsub("TGFβ", "TGFB1", all_genes)
all_genes <- gsub("TGFβR", "TGFB1R", all_genes)
all_genes <- gsub("TGFB1R", "TGFBR1", all_genes)
all_genes <- gsub("IL-1R", "IL1R2", all_genes)

all_genes <- sort(all_genes)

#setdiff(all_genes, rownames(seurat_data))
#grep("TGFB", rownames(seurat_data), value = T)

for(gene in all_genes){
  message(gene)
  
  print(FeaturePlot(seurat_data,
              slot = "data",
              features = gene,
              order = T,
              reduction = "sp",
              raster = T,
              ncol = 1,
              cols = c("gray89", "tomato3")) &
  coord_fixed(ratio = 1) &
  theme_bw() &
  NoLegend())
}
ALDOC
APOE

BMPR1B

BNIP3L

C1QA

C1QB

C1QC

CAMK2B

CCL2

CCL4

CD44

CD47

CD63

CD72

CD74

CD80

CDH2

CDK4

CDKN2B

CEMIP2

COL1A1

CTSB

CX3CR1

CXCL1

CXCL12

CXCL8

ENO1

FCGR3A

FGFR1

FGFR2

FLT1

FN1

GABRD

GAPDH

GFAP

HIF1A

HK2

HLA-DPB1

HLA-DRA

HMOX1

HOMER1

ICAM1

IFI6

IFNG

IFNGR1

IGFBP2

IGFBP3

IL13RA2

IL1A

IL1B

IL1R2

ISG15

ITGA3

ITGA4

ITGA5

ITGAE

ITGAM

ITGAX

ITGB1

JAK1

LDHA

LYZ

MADCAM1

MARCO

MIF

MX1

NF1

NLRP3

NR4A3

NRP1

OLIG1

OLIG2

OPALIN

OSM

P2RY12

P2RY13

P4HB

PDK4

PECAM1

PGK1

PTPRC

PTPRD

RHOB

RNASE1

S100A8

S100A9

SLC2A1

SPP1

STAT3

STAT4

SYN1

TERT

TGFB1

TGFBI

TGFBR1

TIMP1

TMEM119

TOX

TP53

TYROBP

VCAM1

VEGFA

VEGFB


sessionInfo()
R version 4.3.0 (2023-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] ComplexHeatmap_2.18.0 viridis_0.6.3         viridisLite_0.4.2    
 [4] RColorBrewer_1.1-3    googlesheets4_1.1.0   ggrepel_0.9.3        
 [7] ggpubr_0.6.0          lubridate_1.9.2       forcats_1.0.0        
[10] stringr_1.5.0         dplyr_1.1.2           purrr_1.0.1          
[13] readr_2.1.4           tidyr_1.3.0           tibble_3.2.1         
[16] ggplot2_3.4.2         tidyverse_2.0.0       SeuratDisk_0.0.0.9021
[19] Seurat_5.0.1          SeuratObject_5.0.1    sp_1.6-1             
[22] arrow_21.0.0.1        workflowr_1.7.1      

loaded via a namespace (and not attached):
  [1] RcppAnnoy_0.0.20       splines_4.3.0          later_1.3.1           
  [4] cellranger_1.1.0       polyclip_1.10-4        fastDummies_1.7.3     
  [7] lifecycle_1.0.3        rstatix_0.7.2          doParallel_1.0.17     
 [10] rprojroot_2.0.3        globals_0.16.2         processx_3.8.1        
 [13] lattice_0.21-8         hdf5r_1.3.8            MASS_7.3-60           
 [16] backports_1.4.1        magrittr_2.0.3         plotly_4.10.2         
 [19] sass_0.4.6             rmarkdown_2.22         jquerylib_0.1.4       
 [22] yaml_2.3.7             httpuv_1.6.11          sctransform_0.4.1     
 [25] spam_2.9-1             spatstat.sparse_3.0-1  reticulate_1.29       
 [28] cowplot_1.1.1          pbapply_1.7-0          abind_1.4-5           
 [31] Rtsne_0.16             BiocGenerics_0.48.1    git2r_0.32.0          
 [34] circlize_0.4.15        S4Vectors_0.40.2       IRanges_2.36.0        
 [37] irlba_2.3.5.1          listenv_0.9.0          spatstat.utils_3.0-3  
 [40] goftest_1.2-3          RSpectra_0.16-1        spatstat.random_3.1-5 
 [43] fitdistrplus_1.1-11    parallelly_1.36.0      leiden_0.4.3          
 [46] codetools_0.2-19       shape_1.4.6            tidyselect_1.2.0      
 [49] farver_2.1.1           stats4_4.3.0           matrixStats_1.0.0     
 [52] spatstat.explore_3.2-1 googledrive_2.1.0      jsonlite_1.8.5        
 [55] GetoptLong_1.0.5       ellipsis_0.3.2         progressr_0.13.0      
 [58] ggridges_0.5.4         survival_3.5-5         iterators_1.0.14      
 [61] foreach_1.5.2          tools_4.3.0            ica_1.0-3             
 [64] Rcpp_1.0.10            glue_1.6.2             gridExtra_2.3         
 [67] xfun_0.39              withr_2.5.0            fastmap_1.1.1         
 [70] fansi_1.0.4            callr_3.7.3            digest_0.6.31         
 [73] timechange_0.2.0       R6_2.5.1               mime_0.12             
 [76] colorspace_2.1-0       scattermore_1.2        tensor_1.5            
 [79] spatstat.data_3.0-1    utf8_1.2.3             generics_0.1.3        
 [82] data.table_1.14.8      httr_1.4.6             htmlwidgets_1.6.2     
 [85] whisker_0.4.1          uwot_0.1.14            pkgconfig_2.0.3       
 [88] gtable_0.3.3           lmtest_0.9-40          htmltools_0.5.5       
 [91] carData_3.0-5          dotCall64_1.0-2        clue_0.3-64           
 [94] scales_1.2.1           png_0.1-8              knitr_1.43            
 [97] rstudioapi_0.14        rjson_0.2.21           tzdb_0.4.0            
[100] reshape2_1.4.4         curl_5.0.0             nlme_3.1-162          
[103] GlobalOptions_0.1.2    cachem_1.0.8           zoo_1.8-12            
[106] KernSmooth_2.23-21     parallel_4.3.0         miniUI_0.1.1.1        
[109] pillar_1.9.0           vctrs_0.6.2            RANN_2.6.1            
[112] promises_1.2.0.1       car_3.1-2              xtable_1.8-4          
[115] cluster_2.1.4          evaluate_0.21          cli_3.6.1             
[118] compiler_4.3.0         rlang_1.1.1            crayon_1.5.2          
[121] future.apply_1.11.0    ggsignif_0.6.4         labeling_0.4.2        
[124] ps_1.7.5               getPass_0.2-4          plyr_1.8.8            
[127] fs_1.6.2               stringi_1.7.12         deldir_1.0-9          
[130] assertthat_0.2.1       munsell_0.5.0          lazyeval_0.2.2        
[133] spatstat.geom_3.2-1    Matrix_1.6-5           RcppHNSW_0.5.0        
[136] hms_1.1.3              patchwork_1.1.2        bit64_4.0.5           
[139] future_1.32.0          shiny_1.7.4            highr_0.10            
[142] ROCR_1.0-11            gargle_1.4.0           igraph_1.4.3          
[145] broom_1.0.4            bslib_0.4.2            bit_4.0.5